package org.rico.hibernate.validator.helloworld.classlevel;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.TYPE;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;


/** An annotation to verify that the date_of_birth field
 *  is properly populated when necessary.
 */
@Target({ TYPE, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Constraint(validatedBy = CheckDateOfBirthValidator.class)
@Documented
public @interface CheckDateOfBirth {

    /** Default violation message. */
    String message() default "{date_of_birth_required.default}";

    /** Default groups. */
    Class<?>[] groups() default { };

    /** Default payload. */
    Class<? extends Payload>[] payload() default { };
}
